package com.nttuan.model.entity;

import android.util.Log;

import org.json.JSONObject;

/**
 * Created by NT Tuan on 10/20/2014.
 */
public class Category {
    private static final String TAG ="category entity";
    public static final String TABLE_NAME = "category";

    public static final String CATEGORY_ID = "categoryId";
    public static final String CATEGORY_NAME = "categoryName";
    public static final String CATEGORY_ICON = "categoryIcon";
    public static final String NOTE = "note";
    public static final String IS_ACTIVE = "isActive";

    private int categoryId;
    private String categoryName;
    private String categoryIcon;
    private String note;
    private boolean isActive;

    public static JSONObject jCategory(Category category){
        try{
            JSONObject object = new JSONObject();
            object.put(CATEGORY_NAME, category.getCategoryName());
            object.put(CATEGORY_ICON, category.getCategoryIcon());
            JSONObject result = new JSONObject();
            result.put(TABLE_NAME, object);
            return  result;
        }catch (Exception e){
            Log.d(TAG, "jCategory:" + e.toString());
        }
        return null;
    }
    public Category(){}
    public Category(int categoryId, String categoryName, String categoryIcon, String note, boolean isActive) {
        this.categoryId = categoryId;
        this.categoryName = categoryName;
        this.categoryIcon = categoryIcon;
        this.note = note;
        this.isActive = isActive;
    }

    public Category(int categoryId) {
        this.categoryId = categoryId;
    }

    public int getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(int categoryId) {
        this.categoryId = categoryId;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getCategoryIcon() {
        return categoryIcon;
    }

    public void setCategoryIcon(String categoryIcon) {
        this.categoryIcon = categoryIcon;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public boolean isActive() {
        return isActive;
    }

    public void setActive(boolean isActive) {
        this.isActive = isActive;
    }
}
